home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office deutch / INFOPATH.NL-NL / INFLR.CAB / FL_CreateSqlServerConnection_snippet_142632_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2005-10-28  |  2KB  |  63 lines

  1. <?xml version="1.0"?>
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.   <CodeSnippet Format="1.0.0">
  4.     <Header>
  5.       <Title>Create a Server based SQLConnection to SQL Server</Title>
  6.       <Author>Microsoft Corporation</Author>
  7.       <Description>Creates a SQL Connection providing replacements for the typical connection name/value pairs</Description>
  8.       <Shortcut>adoCreateSqlConn</Shortcut>
  9.     </Header>
  10.     <Snippet>
  11.       <References>
  12.         <Reference>
  13.           <Assembly>System.Data.dll</Assembly>
  14.         </Reference>
  15.         <Reference>
  16.           <Assembly>System.Xml.dll</Assembly>
  17.         </Reference>
  18.       </References>
  19.       <Imports>
  20.         <Import>
  21.           <Namespace>System.Data.SqlClient</Namespace>
  22.         </Import>
  23.         <Import>
  24.           <Namespace>System.Data</Namespace>
  25.         </Import>
  26.       </Imports>
  27.       <Declarations>
  28.         <Literal>
  29.           <ID>conn</ID>
  30.           <Type>SqlConnection</Type>
  31.           <ToolTip>Replace this with the name of the connection object.</ToolTip>
  32.           <Default>conn</Default>
  33.         </Literal>
  34.         <Literal>
  35.           <ID>serverName</ID>
  36.           <Type>String</Type>
  37.           <ToolTip>Replace this with the name of the server.</ToolTip>
  38.           <Default>ServerName</Default>
  39.         </Literal>
  40.         <Literal>
  41.           <ID>dataBaseName</ID>
  42.           <Type>String</Type>
  43.           <ToolTip>Replace this with the name of the database.</ToolTip>
  44.           <Default>Northwind</Default>
  45.         </Literal>
  46.         <Literal>
  47.           <ID>userId</ID>
  48.           <Type>String</Type>
  49.           <ToolTip>Replace this with the user name for connectivity to the database.</ToolTip>
  50.           <Default><user name></Default>
  51.         </Literal>
  52.         <Literal>
  53.           <ID>password</ID>
  54.           <Type>String</Type>
  55.           <ToolTip>Replace with the password that corresponds to your user name</ToolTip>
  56.           <Default><your password></Default>
  57.         </Literal>
  58.       </Declarations>
  59.       <Code Language="VB"><![CDATA[Dim $conn$ As New SqlConnection()
  60. $conn$.ConnectionString = "Data Source=$serverName$;Initial Catalog=$dataBaseName$;Persist Security Info=True;User ID=$userId$;Password=$password$"]]></Code>
  61.     </Snippet>
  62.   </CodeSnippet>
  63. </CodeSnippets>